package org.example.core.model.entity;

import lombok.Data;
import lombok.ToString;

/**
 * @author:hzc
 * @date:2024/7/8
 * @desc:
 */
@Data
@ToString
public class CustomResult<T> {
    /* 响应码 */
    private Integer code;
    /* 响应消息 */
    private String message;
    /* 响应体 */
    private T data;

    public CustomResult(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public CustomResult(T data) {
        this.code = 200;
        this.message = "success";
        this.data = data;
    }

    public CustomResult(Integer code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }
}
